package com.bosssoft.trainee.nontax.common.result;

import lombok.*;
import org.springframework.stereotype.Component;

/**
 * @Description: 返回提示
 * @Author: Luo WenLong
 * @Date: 2022/6/26 14:11
 */
@Component
@Builder
@Setter
@Getter
@ToString
@NoArgsConstructor
public class CodeMsg {
    private int retCode;
    private String message;
    // 按照模块定义CodeMsg
    // 通用异常
    public static final CodeMsg SUCCESS = new CodeMsg(0,"success");
    public static final CodeMsg SERVER_EXCEPTION = new CodeMsg(500100,"服务端异常");
    public static final CodeMsg PARAMETER_ISNULL = new CodeMsg(500101,"输入参数为空");
    // 业务异常
    public static final CodeMsg USER_NOT_EXIST = new CodeMsg(500102,"用户不存在");
    public static final CodeMsg TOKEN_ERROR = new CodeMsg(500102,"用户不存在");
    public static final CodeMsg ONLINE_USER_OVER = new CodeMsg(500103,"在线用户数超出允许登录的最大用户限制。");
    public static final CodeMsg SESSION_NOT_EXIST =  new CodeMsg(500104,"不存在离线session数据");
    public static final CodeMsg NOT_FIND_DATA = new CodeMsg(500105,"查找不到对应数据");
    public static final CodeMsg DATA_CAN_NOT_BEEN_MODIFY = new CodeMsg(500105,"数据不可被修改");
    public static final CodeMsg USER_OR_PASS_ERROR = new CodeMsg(500102,"账号或者密码错误，请重试！");
    public static final CodeMsg ROLE_ADD_FAILURE = new CodeMsg(500102,"添加角色异常");


    private CodeMsg(int retCode, String message) {
        this.retCode = retCode;
        this.message = message;
    }

    public int getRetCode() {
        return retCode;
    }
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
}
